From 1c71edc423e425fb29f56b65f7486272c2cb5ff8 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 10 Jan 2006 22:22:49 +0000 Subject: [PATCH] Memory leak fix: release badchars member directly because currently setshort_badchars() always allocates something. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1686 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/mkshort.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index cba30f3e4..d0938b134 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -172,7 +172,10 @@ mkshort_del_handle(short_handle *h) xfree(s); } } - setshort_badchars(*h, NULL); + /* setshort_badchars(*h, NULL); ! currently setshort_badchars() always allocates something ! */ + if (hdr->badchars != NULL) { + xfree(hdr->badchars); + } setshort_goodchars(*h, NULL); if (hdr->defname) { xfree(hdr->defname); -- 2.30.2